package com.zzyl.common.utils;

/**
 * @Description TODO
 * @Author bo.li
 * @Date 2025/5/23 19:37
 * @Version 1.0
 */
public class UserIdThreadLocalUtil {

    private static final ThreadLocal<Integer> USER_ID_THREAD_LOCAL = new ThreadLocal<>();

    public static void setUserId(Integer userId){
        USER_ID_THREAD_LOCAL.set(userId);
    }

    public static Integer getUserId(){
        return USER_ID_THREAD_LOCAL.get();
    }

    public static void remove(){
        USER_ID_THREAD_LOCAL.remove();
    }
}